<template>
	<div class="tabs">
		<div class="tab cur" :class="{active:active==item.id}" @click="getactive(item.id)" v-for="(item,index) in list"
			:key="index"><span>{{ item.name }}</span>
		</div>
	</div>
</template>
<script>
	export default {
		name: "tabs",
		components: {},
		props: {
			list: {
				type: Array,
				default () {
					return [];
				}
			},
			active: {
				type: Number | String,
				default () {
					return 0;
				}
			},
		},
		data() {
			return {

			}
		},
		watch: {},
		mounted() {},
		methods: {
			getactive(e) {
				this.$emit('update:active', e)
			},
		}
	}
</script>
<style scoped lang="scss">
	.tabs {
		display: flex;
		justify-content: flex-start;
		align-items: center;
		flex-wrap: nowrap;
		flex-direction: row;
		margin: auto;

		.tab {
			font-size: 24rpx;
			font-family: MicrosoftYaHei;
			font-weight: 400;
			color: #000000;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-wrap: nowrap;
			flex-direction: column;
			min-width: 88rpx;
			height: 60rpx;
			background: rgba(244, 246, 250, 1.00);
			border-radius: 8rpx;
			margin-right: 16rpx;

			span {
				font-size: 28rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: rgba(33, 33, 33, 1.00);
				padding: 0 24rpx;
			}

		}

		.tab.active {
			span {
				color: rgba(94, 134, 254, 1.00);
			}
		}
	}
</style>
